<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>setup</title>
</head>
<body>
<div id="app">

</div>
<script src="../vue.global.js"></script>
<script>
    const app = Vue.createApp({
        setup(props, context) {

            const {ref} = Vue;
            let msg = ref("hello")
            return {
                msg,
                log: () => {
                    alert("message")
                }
            }
        },
        template:` {{msg}}
        <button @click="log">点我</button>
        <button @click="msg=123">修改msg</button>
        `

    }).mount("#app")
</script>
</body>
</html>